|
The Sierpiński arrowhead curve is a fractal curve similar in appearance and identical in limit to the Sierpiński triangle. The Sierpinski arrowhead curve draws an equilateral triangle with triangular holes at equal intervals. It can be described with two substituting production rules: (A → B-A-B) and (B → A+B+A). A and B recur and at the bottom do the same thing — draw a line. Plus and minus (+ and -) mean turn 60 degrees either left or right. The terminating point of the Sierpinski arrowhead curve is always the same provided you recur an even number of times and you halve the length of the line at each recursion. If you recur to an odd depth (order is odd) then you end up turned 60 degrees, at a different point in the triangle. In code, given these drawing functions: void draw_line( double distance); void turn( int angle_in_degrees); The code to draw an (approximate) Sierpinski arrowhead curve looks like this. void sierpinski_arrowhead_curve( unsigned order, double length) } void curve( unsigned order, double length, int angle) } ==Representation as Lindenmayer system== The Sierpiński arrowhead curve can be expressed by a rewrite system (L-system). :Alphabet: X, Y :Constants: F, +, − :Axiom: XF :Production rules: : X → YF + XF + Y : Y → XF − YF − X Here, ''F'' means “draw forward”, + means “turn left 60°”, and ''−'' means “turn right 60°” (see turtle graphics). Like many two-dimensional fractal curves, the Sierpiński arrowhead curve can be extended to three dimensions: 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Sierpiński arrowhead curve」の詳細全文を読む スポンサード リンク
|